package com.gitee.loyo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备类型
 */
@Getter
@AllArgsConstructor
public enum EquipmentType {
    DC(1, "直流设备"),AC(2, "交流设备"),ACDC(3, "交直流一体设备"),WIRELESS(4, "无线设备"),OTHER(5, "其他");

    private int code;
    private String text;

    public static EquipmentType valueOf(int code){
        switch (code){
            case 1: return DC;
            case 2: return AC;
            case 3: return ACDC;
            case 4: return WIRELESS;
            case 5: return OTHER;
        }
        throw new UnsupportedOperationException("unknown code: " + code);
    }
}
